package com.zareal.ymcc.enums;

import lombok.Getter;

@Getter
public enum  GlobalErrorCode {
    OK("success","1"),
    NOT("程序猿跑了，我们正在追他","-1"),
    ERROR("操作错误","-1"),
    // 100xx公共异常
    IS_NULL("参数不能为空","10000"),
    PASSWORD_IS_NULL("密码不能为空","10001"),
    PARAM_IS_NULL_ERROR("参数不能为空","10002"),
    SERVICE_ERROR("服务器故障","10003"),
    // system 200xxx
    // user 300xxx
    USER_IS_EXISTED("用户已注册","30001"),
    USER_LOGIN_ERROR("登录失败","30002"),
    USER_IN_BLACK("该手机号被拉黑了","30003"),
    USER_FIND_ERROR("用户查询失败","30004"),
    // 400 uaa
    USER_NO_PERMISSION_ERROR("没有权限","40001"),
    // 500xxcommon
    PHONE_IS_NULL_ERROR("手机号格式错误或者为空","50001"),
    IMAGECODE_IS_NULL("图形验证码为空或者过期","50002"),
    IMAGECODE_IS_ERROR("图形验证码错误","50003"),
    REPEATOBTAIN_ERROR("重复获取验证码","50004"),
    PHONECODETIME_TOO_SHORT("近期获取过手机验证码","50005"),
    PHONECODE_IS_NULL("手机验证码为空或者过期","50006"),
    PHONE_IS_ERROR("手机验证码错误","50007"),
    BLACK_PHONE("黑名单滚啊","50008"),



    // 600xxx 课程全局异常
    COURSE_IS_EXISTS("课程存在,不可添加","60001"),
    COURSE_IS_NULL("课程不存在","60002"),
    COURSE_ALREADY_ONLINE("课程已上架","60003"),
    COURSE_ALREADY_OFFLINE("课程已下架","60004"),
    COURSE_SEARCH_FUSE("ES保存或者删除课程熔断","60005"),
    COURSE_TYPE_IS_NULL("课程类型不存在","60006"),
    COURSE_MARKET_IS_ERROR("课程销售信息短融","60007"),
    COURSE_MARKET_GET_ERROR("销售信息获取失败","60008"),
    COURSE_USER_BUY_INFO_GET_ERROR("获取用户购买信息获取失败","60009"),
    COURSE_PERMISSION_ERROR("没有购买课程","600010"),
    COURSE_EXPIRED_ERROR("课程到期","600011"),
    ORDER_COURSE_LENGTH_NOT_MATCH("课程订单确实id长度不匹配","600012"),


    // 700 视频问题
    MEDIA_IS_NULL("视频为空","70001"),

    // 900 课程订单问题
    ORDER_TOKEN_IS_NULL("redis为空或者不存在","90001"),
    ORDER_COURSE_IS_NULL("获取课程信息为空或者失败","90001"),

    // 10100支付的时候问题
    ORDER_TO_PAY_IS_NULL("订单传输信息失败","10101"),
    PAY_ORDER_IS_NULL("订单生成失败","10101"),
    PAY_STATUS_IS_ERROR("已经支付或者取消支付","10101"),

    // 10110秒杀
    ACTIVITY_ALREADY_ONLINE("秒杀活动已上架","10110"),
    ACTIVITY_ALREADY_OFFLINE("秒杀活动已下架","10111"),
    ACTIVITY_ALREADY_IS_PUBLISH("秒杀活动已发布","10112"),
    ACTIVITY_ALREADY_NOT_PUBLISH("秒杀活动未发布","10113"),
    KILLCOURSE_ALREADY_ONLINE("秒杀课程已上架","10114"),
    KILLCOURSE_ALREADY_OFFLINE("秒杀课程已下架","10115"),
    ACTIVITY_IS_NULL("活动不存在","10116"),
    KILLCOURSE_IS_NULL("活动课程不存在","10118"),
    ACTIVITYTIME_ALREADY_PASS("活动上架时间已过","10117"),
    ;

    // 异常信息
    private String errorMessage;

    // 异常码
    private String errorCode;


    private GlobalErrorCode(String errorMessage, String errorCode) {
        this.errorMessage = errorMessage;
        this.errorCode = errorCode;
    }

}
